package cn.edu.scau.cmi.dengyu.abstractFactory.factory;

import cn.edu.scau.cmi.dengyu.domain.factory.Accident;
import cn.edu.scau.cmi.dengyu.domain.factory.CarDamagedInPingAn;
import cn.edu.scau.cmi.dengyu.domain.factory.DriverInjuredInPingAn;
import cn.edu.scau.cmi.dengyu.domain.factory.MultipleAccidentsInPingAn;
import cn.edu.scau.cmi.dengyu.domain.factory.PeopleInjuredInPingAn;

public class PingAnFactory extends AbstractFactory{
	public Accident getAccident(String accidentType) {
		switch (accidentType) {
		case "司机受伤":
			return new DriverInjuredInPingAn();
		case "汽车损坏":
			return new CarDamagedInPingAn();
		case "人员伤亡":
			return new PeopleInjuredInPingAn();
		case "多种事故":
			return new MultipleAccidentsInPingAn();
		}
		return null;

	}
}
